package com.sushi.controller;

import com.sushi.service.BlackService;
import com.sushi.response.ResponseBO;
import com.sushi.response.ResponsePageBO;
import com.sushi.response.BlackResp;
import com.sushi.request.BlackReq;
import com.sushi.request.BlackPageReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.*;

/**
 * 黑名单 控制器
 * @date 2023-05-02
 * @time 17:12:46
 * @author Administrator
 */
@RestController
@Slf4j
public class BlackController {

	@Autowired
	private BlackService blackService;

    

    /**
     * 新增
     */
    @PostMapping("/black/add")
    public ResponseBO<BlackResp> add(@RequestBody BlackReq req) {
        return blackService.add(req);
    }

    /**
     * 逻辑删除
     */
    @PostMapping("/black/remove")
    public ResponseBO<BlackResp> remove(@RequestBody BlackReq req) {
        return blackService.logicRemove(req);
    }

    /**
     * 更新
     */
    @PostMapping("/black/update")
    public ResponseBO<BlackResp> update(@RequestBody BlackReq req) {
        return blackService.updateByField(req);
    }

    /**
     * 列表
     */
    @PostMapping("/black/list")
    public ResponsePageBO<BlackResp> list(@RequestBody BlackPageReq req) {
        return blackService.listByCondition(req);
    }

    /**
     * 详情
     */
    @PostMapping("/black/detail")
    public ResponseBO<BlackResp> detail(@RequestBody BlackReq req) {
        return blackService.detail(req);
    };

}